package com.niit.service.impl;

import com.niit.entity.Admin;
import com.niit.repository.AdminRepository;
import com.niit.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminRepository adminRepository;

    @Override
    public Admin findByInfoId(Integer id) {
        return adminRepository.findAdminByInfo_Id(id);
    }

    @Override
    public Admin save(Admin admin) {
        return adminRepository.save(admin);
    }

    @Override
    public Admin findById(Integer id) {
        return adminRepository.findById(id).orElse(null);
    }


}
